USE [{WebDatabase}]
GO
/****** Object:  Table [dbo].[Segment]    Script Date: 10/14/2006 20:11:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Segment]
(
    [SegmentId]       [int] IDENTITY(1,1) NOT NULL
,   [ClientId]        [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [SegmentName]     [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [SortOrdinal]     [tinyint] NULL
,   [CreateDate]      [datetime] NULL CONSTRAINT [DF_Segment_createDate]  DEFAULT (getdate())
,   [ParentSegmentId] [int] NULL
,   [IsActive]        [bit] NULL
,
CONSTRAINT [PkSegment] PRIMARY KEY CLUSTERED([SegmentId] ASC)
WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
)
ON [PRIMARY]
GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Segment]
WITH NOCHECK ADD  CONSTRAINT [FkSegmentParentSegment]
FOREIGN KEY([ParentSegmentId])
REFERENCES [dbo].[Segment] ([SegmentId])
GO

ALTER TABLE [dbo].[Segment] NOCHECK CONSTRAINT [FkSegmentParentSegment]